package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.chat.result.RollingMsgListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.chat.vo.RollingMsgIdForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.chat.vo.RollingMsgListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.chat.vo.RollingMsgSaveForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.chat.vo.RollingMsgUpdateForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.chat.RollingT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by zhaojp18008 on 2016/5/17.
 */
@Controller
public class RollingMsgController {
    
    @Resource
    private RollingT2BizService rollingT2;
    
    /**
     * 滚动消息保存
     * */
    @ResponseBody
    @RequestMapping("/func_rolling_msg_save")
    @SaveLog(remark = "滚动消息保存")
    public HSBCPSBackVO funcRollingMsgInfoSave(HttpServletRequest request , String jsonpcallback){
        RollingMsgSaveForm form = getSingleParameterMapForBody(request , RollingMsgSaveForm.class);
        return VOUtil.setJsonpResult(rollingT2.funcRollingMsgInfoSave(form), jsonpcallback);
    }
    
    /**
     * 滚动消息修改
     * */
    @ResponseBody
    @RequestMapping("/func_rolling_msg_update")
    @SaveLog(remark = "滚动消息修改")
    public HSBCPSBackVO funcRollingMsgUpdate(HttpServletRequest request , String jsonpcallback){
        RollingMsgUpdateForm form = getSingleParameterMapForBody(request , RollingMsgUpdateForm.class);
        return VOUtil.setJsonpResult(rollingT2.funcRollingMsgUpdate(form), jsonpcallback);
    }
    /**
     * 滚动消息删除
     * */
    @ResponseBody
    @RequestMapping("/func_rolling_msg_del")
    @SaveLog(remark = "滚动消息删除")
    public HSBCPSBackVO funcRollingMsgDel(HttpServletRequest request , String jsonpcallback){
        RollingMsgIdForm form = getSingleParameterMapForBody(request , RollingMsgIdForm.class);
        return VOUtil.setJsonpResult(rollingT2.funcRollingMsgDel(form), jsonpcallback);
    }
    /**
     * 滚动消息获取
     * */
    @ResponseBody
    @RequestMapping("/func_rolling_msg_list_get")
    @SaveLog(remark = "滚动消息获取")
    public RollingMsgListResult funcRollingMsgListGet(HttpServletRequest request , String jsonpcallback){
        RollingMsgListForm form = getSingleParameterMapForBody(request , RollingMsgListForm.class);
        return VOUtil.setJsonpResult(rollingT2.funcRollingMsgListGet(form), jsonpcallback);
    }

}
